package com.xiaozhuyao.controller;

import com.xiaozhuyao.bean.User;
import com.xiaozhuyao.common.ServerResponse;
import com.xiaozhuyao.service.IUserService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.UUID;

@Controller
@RequestMapping("user")
public class UserController {
    @Autowired
    private IUserService iUserService;

    @RequestMapping(value = "getUser/{uuid}", method = RequestMethod.GET)
    @ResponseBody
    public ServerResponse<User> getUser(@PathVariable("uuid") String uuid) {
        System.out.println(uuid);
        User user = iUserService.selectUser(uuid);
        System.out.println(user.getPassword());
        return ServerResponse.createBySuccess("获取成功", user);
    }
}
